<?php
	// URLのパラメータを維持する
	// http://book.cakephp.org/view/166/Pagination-in-Views
	$sanitizedGetVal = h($this->params['named']['au_name']);
	$this->passedArgs = "au_name:{$sanitizedGetVal}";
	$paginator->options(array('url' => $this->passedArgs));
?>

<?php echo $form->create(null, array('url' => array('controller' => 'exports', 'action' => 'export', "au_name:{$sanitizedGetVal}"))); ?>

<div class="pageContents ledaResolvers index">

<h2>"<?php echo $sanitizedGetVal ?>"の検索結果 : <?php echo $paginator->counter( array( 'format' => __('%count%', true) ) ); ?>件</h2>

<p>リストの見出しをクリックすると並び替えができます</p>

<table id="profileTable" class="miscTable" align="center" width="90%">
<thead>
<tr>
	<th width="5%">全選択<br /><input type="checkbox" id="allCheck"></th>
	<th width="10%">発行</th>
	<th>タイトル</th>
	<th width="20%">著者</th>
	<th width="10%">アクセス数</th>
</tr>
</thead>
<?php foreach ($ledaResolvers as $ledaResolver): ?>
	<tr>
		<td class="centerAlign"><?php echo $form->checkbox('id', array('class' => 'check', 'id' => "LedaResolverId{$ledaResolver['LedaResolver']['id']}", 'name' => "data[LedaResolver][id][{$ledaResolver['LedaResolver']['id']}]" ) ); ?></td>
		<td class="leftAlign"><?php echo $ledaResolver['LedaResolver']['date_issued']; ?></td>
		<td class="leftAlign"><!-- <?php echo $ledaResolver['LedaResolver']['title']; ?> ソート用コメント --><strong><a href="<?php echo $ledaResolver['LedaResolver']['uri']; ?>"><?php echo $ledaResolver['LedaResolver']['title']; ?></a></strong></td>
		<td class="leftAlign">
			<?php foreach( $ledaResolver['Itemsbyauthor'] as $key => $value ) : ?>
				<?php echo $value['author']; ?>
			<?php endforeach; ?>
		</td>
		<td class="centerAlign">
			<?php
				$key = $accesscount->accesscount($ledaResolver['LedaResolver']['uri']);
				if ( isset($accesslogs[$key]) ) {
					echo $accesslogs[$key];
				} else {
					echo '--';
				}
			?>
		</td>
	</tr>
<?php endforeach; ?>
</table>

</div>

<div>
	<p>エクスポートする文献を選択してください</p>

	<ul>
		<li><!-- // CSV形式でエクスポート -->
		<?php echo $form->submit(__('CSV(通常)形式でエクスポート', true), array("name" => "csv", "div" => false, "label" => false) ); ?>
		</li>
		<li><!-- // CSV形式でエクスポート -->
		<?php echo $form->submit(__('CSV(多国語対応)形式でエクスポート', true), array("name" => "utf", "div" => false, "label" => false) ); ?>
		</li>
		<li><!-- // BibTeX形式でエクスポート -->
		<?php echo $form->submit(__('BibTeX形式でエクスポート', true), array("name" => "bibtex", "div" => false, "label" => false) ); ?>
		</li>
		<br />
		<!-- // 研究者情報へのリンク -->
		<?php
			foreach($ledaRlinks as $items) {
				if ( !isset($items['LedaRlink']) ) break;
				$url = $ledarlink->ledarlink($items['LedaRlink']['au_id']);
				$link = $html->link(__('「'.$items['LedaRlink']['name'] . '」の研究者情報ページへ', true), $url, array('class'=>'button'));
				echo "<li>{$link}</li>";
			}
		?>
		<li><a href="http://www.google.co.jp/search?ie=UTF-8&q=<?php echo urlencode($sanitizedGetVal) ?>">Googleで「<?php echo $sanitizedGetVal ?>」を検索</a></li>
		<li><a href="http://scholar.google.com/scholar?ie=UTF-8&q=<?php echo urlencode($sanitizedGetVal) ?>">Google Scholarで「<?php echo $sanitizedGetVal ?>」を検索</a></li>
		<br />
		<li><a href="#" onclick="history.back(); return false">戻る</a></li>
	</ul>
</div>

<?php echo $form->end(); ?>
